#ifndef  _PL1167_H
#define   _PL1167_H

#include "main.h"

//#define    TEST_TX   1
#define    TEST_RX   1


#define  RF_RST_1		P01 = 1		//GPIOC->ODR|=PIN_7
#define  RF_RST_0		P01 = 0		//GPIOC->ODR&=~PIN_7

#define  SPI_CS_1		P06 = 1		//GPIOD->ODR|=PIN_5
#define  SPI_CS_0		P06 = 0		//GPIOD->ODR&=~PIN_5

#define  SPI_CLK_1		P05 = 1		//GPIOD->ODR|=PIN_4
#define  SPI_CLK_0		P05 = 0		//GPIOD->ODR&=~PIN_4

#define  SPI_MOSI_1		P00 = 1		//GPIOC->ODR|=PIN_6
#define  SPI_MOSI_0		P00 = 0		//GPIOC->ODR&=~PIN_6

#define  SPI_MISO		P14			//(BitStatus)(GPIOB->IDR & (vu8)PIN_5)
#define  PKT			P07			//(BitStatus)(GPIOD->IDR & (vu8)PIN_6)


#define  SPI_MISO_IN  	P14_Input_Mode	

extern u8     Sync_Flag;
extern u8     ID_Tx[3];

void ReadReg(u8 reg);
void WriteSpi(u8 Val);
void Pl1167_Init(void);  
BitStatus ReadReg_Init(void);
 
 //void PL1167_Send(u8 NUM,u8 *TXD_BUFF,u8 Ch_NO);
 
void Pl1167_Init_TX(void);
void PL1167_REC(u8 *BF);
void PL1167_Send(u8 NUM,u8 *TXD_BUFF,u8 Ch_NO);
void	RXD_Init(u8 Ch_NO);
 
#endif